// 04jyhs/EvaluateManage/EvaluateManage.js
var co = require("../../../resource/js/common.js")
var _this, _data, _pagenum,_obj
var app = getApp()
Page({
   data: {
      UserEvaluateList: [], //已评价订单列表
      hint: true,
      frame_h: 1800 //frame高度
   },
   onLoad: function(opt) {
      _this = this
      _data = _this.data
      _obj = JSON.parse(opt.orderid)
      _this.setData({
         frame_h: wx.getSystemInfoSync().windowHeight + 10
      })
      _pagenum = 1
      _this.getEvaluateList()
   },
   onUnload: function () {
      _pagenum = 1
   },
   onReachBottom: function () {
      _this.getEvaluateList()
   },
   //获取已评价订单列表
   getEvaluateList() {
      wx.showLoading({
         title: '正在加载数据中...',
      })
      co.getJyhsApi("order/Order/getOrderList", {
         Reclaim_User_ID:_obj.User_ID,
         Order_Status: 3,
         page: _pagenum
      }, function(res) {
         if (res.code == 0) {
            wx.hideLoading()
            _this.setData({
               UserEvaluateList: res.data
            })
            _pagenum++
         } else {
            _this.setData({
               hint: false
            })
            co.toastAllText(res.msg)
         }
      })
   },
   //跳转至已评价的订单详情评价内容
   gotoEvaluateContent(e) {
      var index = e.currentTarget.dataset.index
      var obj_json = JSON.stringify(_data.UserEvaluateList[index])
      wx.navigateTo({
         url: '/04jyhs/EvaluateManage/EvaluateManageDetail/EvaluateManageDetail?orderid=' + obj_json,
      })
   },
})